<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="beans.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
* {
	margin: 0px;
	padding: 0px;
}

body{
padding:10px;
}

p {
	text-indent: 2em;
	line-height: 1.3em;
	font-size: 13px;
}

table{
	margin:10px;
	border-collapse: collapse;
	font-size:15px;
	width:95%;	
}

tr{
	border-bottom:1px solid gray;	
}

th{
	text-align: left;
}
</style>
</head>
<body>
	<%
		
		String minage=request.getParameter("minage");
		String maxage=request.getParameter("maxage");
		String sql="select * from user where user_age>"+minage+" and user_age<"+maxage;
		
		//从下面是正式从数据库中取出的数据，放在div4中
		List<Map<String, Object>> list4= null;
		UserDAO userDAO=new UserDAO();
		list4=userDAO.findwhere(sql);
		pageContext.setAttribute("list4", list4);
		
	
	%>
	
	
	
	下面使用真正的数据库中数据，放入到list4，用jstl表达<br>
	<div id="all4">
		<table>
			<tr>
				<th>号码</th>
				<th>密码</th>
				<th>姓名</th>
				<th>年龄</th>
				<th>性别</th>
				<th>兴趣</th>
			</tr>
			<c:forEach var="temp" items="${list4 }">
				<tr>
					<td>${temp.userno}</td>
					<td>${temp['userpwd']}</td>
					<td>${temp.username}</td>
					<td>${temp.userage}</td>
					<td>${temp.usersex}</td>
					<td>${temp.userinterest}</td>
				</tr>
			</c:forEach>			
		</table>	
	</div>
</body>
</html>